package cn.ldw.controller;

import cn.ldw.service.SignInfoService;
import cn.ldw.vo.PageParams;
import cn.ldw.vo.PunchRecordParams;
import cn.ldw.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/click")
public class SignInfoController {
    @Autowired
    private SignInfoService signInfoService;

    @RequestMapping("/total")
    public Result signTotal(String username) {
        return signInfoService.signTotal(username);
    }

    @RequestMapping("/record")
    public Result record(@RequestBody PageParams params) {
        return signInfoService.record(params);
    }

    @RequestMapping("/punch")
    public Result record(@RequestBody PunchRecordParams punchRecordParams) {
        return signInfoService.punch(punchRecordParams);
    }

    @RequestMapping("/recent")
    public Result recent() {
        return signInfoService.recent();
    }

    @RequestMapping("/getName")
    public Result getName() {
        return signInfoService.getName();
    }

    @RequestMapping("/statistic/bar")
    public Result statisticBar() {
        return signInfoService.statisticBar();
    }

    @RequestMapping("/statistic/pie")
    public Result statisticPie() {
        return signInfoService.statisticPie();
    }

    @RequestMapping("/statistic/line")
    public Result statisticLine() {
        return  signInfoService.statisticLine();
    }
}
